package yxy.game.pm2.bean.module.rank.openserviceactive;

import yxy.game.pm2.bean.module.rank.RankEntry;
import yxy.game.pm2.bean.module.rank.openserviceactive.herorushrank.OpenServiceHeroRushRank;

import java.util.Collection;

/**
 * <p>开服冲榜门面接口，主要提供如下功能<p/>
 * <pre>
 *     更新排行榜{@link OpenServiceRushRankHandle#updateHeroRanking(String, int, int)}
 *     通过参数获取排行榜的前几名的信息{@link OpenServiceRushRankHandle#top(String, int, int)}
 * </pre>
 *
 *
 * @ClassName OpenServiceRushRankHandle
 * @Author jingtao-zheng
 * @Date 2022/7/6 17:18
 * @Version 1.0
 **/
public class OpenServiceRushRankHandle {
    /**
     * 更新排行榜，rankingType不同，调用地点不同
     * @param heroId 武将id
     * @param rankingType 排行榜类型
     * <p>在所有的招募武将和武将碎片合成武将处调用
     * @see yxy.game.pm2.module.gacha.GachaHeroHandle#summonHero(yxy.game.pm2.module.gacha.GachaHeroModule, yxy.game.pm2.module.gacha.GachaHeroType, int, yxy.game.pm2.message.HeroMessage.GachaHeroResponse.Builder)
     * @see yxy.game.pm2.module.hero.HeroHandle#chipCompound(String, yxy.cherry.data.bean.debris, int)
     */
    static public boolean updateHeroRanking(String playerCode, int heroId, int rankingType){
        return OpenServiceHeroRushRank.updateHeroRanking(playerCode, heroId, rankingType);
    }

    /**
     * 获取前【size】名
     * @param playercode 玩家code
     * @param rankrushtype  排行榜类型
     * @param size 前多少名
     * @return Collection<RankEntry> 排名信息
     */
    static public Collection<RankEntry> top(String playercode, int rankrushtype, int size){
        return OpenServiceHeroRushRank.top(playercode,rankrushtype,size);
    }

    /**
     * 获取排名范围内的对象
     * @param rankrushtype 排名类型
     * @param min 区间
     * @param max 区间
     * @return Collection<RankEntry> 排名信息
     * 发奖励的时候用到这里{@link yxy.game.pm2.active.module.openservicerank.OpenServiceHeroRushFutureHandle#lssueReward(yxy.game.pm2.active.module.openservicerank.OpenServiceRushModule, yxy.game.pm2.bean.area.AreaBean, int, org.joda.time.DateTime)}
     */
    static public Collection<RankEntry> range(int areaid, int rankrushtype, int min, int max){
        return OpenServiceHeroRushRank.range(areaid,rankrushtype,min,max);
    }

    /**
     * 通过playercode和活动类型type获取该玩家在该活动的个人信息
     * @param rankrushtype 活动类型
     * @return 单人信息
     */
    static public RankEntry get(String playercode, int rankrushtype){
        return OpenServiceHeroRushRank.get(playercode,rankrushtype);
    }

    /**
     * 通过playercode和活动类型type获取该玩家在该活动的排名
     * @param rankrushtype 活动类型
     * @return 单人排名
     */
    static public int rank(String playercode, int rankrushtype){
        return OpenServiceHeroRushRank.rank(playercode,rankrushtype);
    }
}
